package com.pass.two;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

/**
 * Pass Two collects all the output files of Pass One Reducer, emits <-1, edge
 * edge egde...>. Only one reducer is processing the outputs.
 */
public class PassTwoMapper extends
		Mapper<LongWritable, Text, IntWritable, Text> {
	@Override
	protected void map(LongWritable key, Text value, Context context)
			throws IOException, InterruptedException {
		String[] keyVal = value.toString().split("\\t");
		context.write(new IntWritable(-1), new Text(keyVal[1]));
	}
}